/**
 * 项目费用页签
 * @author liuw
 * @date 2019/12/16
 */
define(function () {
    var self,
        app = win.app,
        doc = document,
        layui = win.layui,
        cols = [[
            {field: "GWGL001", width: 100, title: "招标编号", search: "default", searchOpts: {icon: true},sort:true}
            , {field: "GWGL005_NAME", width: 100, title: "参标单位"}
            , {field: "GWGL006_NAME", width: 100, title: "付款单位"}
            , {field: "GWGL009", width: 100, title: "费用类型",filterDatas:app.datas_("gwgl009")}
            , {field: "GWGL015", width: 100, title: "金额（元）"}
            , {field: "GWGL019_NAME", width: 100, title: "申请人", hide: true, search: "default", searchOpts: {icon: true}}
            , {field: "GWGL026", width: 100, title: "退还时间",sort:true}
            , {field: "GWGL018", width: 100, title: "退还说明"}
        ]],
        pageVue,
        table, form,
        table_where = {
            GWAK001: ''
        }
    ;

    var gwglBookmark = app.Module.extend({
        init: function () {
            self = this;
            self._super({
                _tag: 'gwglBookmark'
            }, win);
        },

        initTable: function () {
            layui.use(['table'], function () {
                table = layui.table;
                form = layui.form;
                table.render({
                    elem: app.getByid(doc, 'gwglBookmark'),
                    url: g_ctxPath + 'crm/gwgi006/getBookmarkData',
                    method: 'post',
                    id: 'gwglBookmark',
                    size: _layuiConfig.ui_size,
                    autoSort: false, //禁用前端自动排序
                    height: 'full-10',
                    cols: cols,
                    loading: true,
                    page: true,
                    where: table_where,
                    done: function (res, curr, count) {

                    }
                });

            });
        },

        tableReload: function (listData) {
            self._reloadTable({id: 'gwglBookmark', where: table_where});
        },

        _ready: function () {
            table = layui.table;
            pageVue = new Vue({
                el: '#gwglBookmark',
                data: {},
                methods: {
                    cancle: function () {
                        self._closeTpl();
                    }

                },
                created: function () {
                    self._setEleIsReady('gwglBookmark');
                }
            });
            self.initTable();
        },
        _lazy: function () {
            this._super();
        }
    });

    return new gwglBookmark();

})
;